package com.aaa.fpa.controller;

import com.aaa.fpa.service.AccountService;
import com.aaa.pojo.Page;
import com.aaa.pojo.Result;
import com.aaa.pojo.ResultBean;
import com.aaa.pojo.question_fpa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

@Controller
@RequestMapping("/account")
@ResponseBody
public class AccountController {
    @Autowired
    private AccountService accountService;

    @RequestMapping(value = "/findAll"/*, produces = {"application/json;charset=UTF-8"}*/)

    public ResultBean findAll(Page page,question_fpa question_fpa)
    {

        return accountService.findAll(page,question_fpa);
    }








    @RequestMapping("/delete")
        public  int delete(Integer id){
        int delete = accountService.delete(id);
        return delete;
    }
    @RequestMapping("save")
    public  int save(question_fpa question_fpa){

        return accountService.save(question_fpa);
    }
    @RequestMapping("update")
    public  int update(question_fpa question_fpa){

        question_fpa.setCreate_time(new Date());
        return accountService.update(question_fpa);
    }
    @RequestMapping("deletes")
    public  int deletes(@RequestParam  Integer[ ] id){

return accountService.deletes( id);

    }


}
